package com.aiyige.model.enums;

import com.aiyige.model.request.OrderStatusEnum;


/**
 * Created by xiachao on 2017/11/17.
 */
//    进详情页的入口，0-首页，1-全局搜索，2-订单，3-收藏，4-浏览历史，5-缓存，6-商品管理，7-已买
public enum DetailEnterEnum {

    Home0(0,"首页"),
    Search1(1,"全局搜索"),
    Order2(2,"订单"),
    Favourite3(3,"收藏"),
    History4(4,"浏览历史"),
    Cache5(5,"缓存"),
    GoodsManager6(6,"商品管理"),
    Buyed7(7,"我的学习");


    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    private boolean selected;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private int type;
    private String value;
    DetailEnterEnum(int type, String value) {
        this.type = type;
        this.value = value;

    }


    /**
     * 根据key获取value
     *
     * @param key
     *            : 键值key
     * @return String
     */
    public static String getValueByKey(int key) {
        OrderStatusEnum[] enums = OrderStatusEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getStatus() == key) {
                return enums[i].getValue();
            }
        }
        return "";
    }
}
